package com.example.spotitube.Controller;

import java.util.Comparator;

import com.example.spotitube.Model.Track;

/**
 * Compares the popularity of two tracks
 * @author Jeffrey
 *
 */
public class PopularityComparator implements Comparator<Track>{
	@Override
	public int compare(Track track1, Track track2){
		
		if (track1.getPopularity() < track2.getPopularity()){
			return 1;
		} else if (track1.getPopularity() > track2.getPopularity()){
			return -1;
		} else {
			return 0;
		}
	}
}
